<?php
declare (strict_types=1);

namespace app\api\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Spec_goods extends Model
{
    protected $table = 'pyg_spec_goods';
    protected $pk = 'id';

    public function addSpecGoods($data){
        return $this->saveAll($data);
    }

    public static function delSpecGoods($id){
        return self::where('goods_id',$id)->delete();
    }

    public static function getSpecGoods($id){
        return self::where('goods_id',$id)->select()->toArray();
    }

    public static function getspecGoodsNum($id){
        return self::where('id',$id)->find()->toArray();
    }
}
